﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ThingyCloud
{
	class Debug
	{
		/// <summary>
		/// When the application is started this should be invoked. Clears the output debug file.
		/// </summary>
		public static void Clear()
		{
		}

		/// <summary>
		/// Format exceptions nicely
		/// </summary>
		/// <param name="e"></param>
		public static void WriteException(Exception e)
		{
			WriteLine(Globals.Separator);
			WriteCleanLine(e.ToString());
			WriteLine(Globals.Separator);
		}

		/// <summary>
		/// With debug messages we normally want a timestamp in front of it
		/// </summary>
		/// <param name="s"></param>
		public static void WriteLine(string s)
		{
			WriteCleanLine("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] " + s);
		}

		/// <summary>
		/// Write a clean line to console and a debug file
		/// </summary>
		/// <param name="s"></param>
		public static void WriteCleanLine(string s)
		{
			// Also write to debug file!

			Console.WriteLine(s);
		}
	}
}